package com.thu.tdnav;

import android.app.Activity;
import android.app.AlertDialog;
import android.os.Bundle;
import android.view.View;
import java.util.ArrayList;  
import java.util.List; 

public class SearchActivity extends MainActivity
{
	@Override
	public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		tdnav appState = (tdnav)this.getApplication();
		appState.addActivity(this);
		setContentView(R.layout.search);
		Bundle extras=getIntent().getExtras();
		String method=extras.getString("method");
		if(method.equals("search"))
		{
			String start=extras.getString("start");
			String end=extras.getString("end");
			MapSearching mapSearching = new MapSearching();
			List<Point> drawingList = new ArrayList<Point>();
			mapSearching.getDrawingList(start,end,drawingList,this);
			//#TODO draw route with drawingList
			showDebugDialog(drawingList.size()+"");
		}
		else if(method.equals("showmap"))
		{
			showDebugDialog("showmap");
		}
	}
	public void backonclick(View view)
	{
		finish();
	}
}